package ace.module.account.core.impl.manager;

import ace.module.account.api.model.dto.IamAccountDto;
import ace.module.account.api.model.input.IamAccountModifyStatusInput;
import ace.module.account.api.model.input.IamAccountSearchInput;
import ace.module.account.api.model.input.IamAccountWithProfileSearchInput;
import ace.module.account.api.model.input.account.IamAdminAccountAdminSearchInput;
import ace.module.account.core.impl.dao.entity.IamAccount;
import ace.module.common.core.impl.manager.EntityOfAppManager;
import java.util.List;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

/**
 * @author caspar
 * @date 2023/3/20 9:28
 */
public interface IamAccountManager extends EntityOfAppManager<IamAccount, Long, IamAccountDto> {

  Page<IamAccountDto> pageWithProfile(String query, Long iamAppId, Pageable pageable);

  Page<IamAccountDto> pageWithProfile(IamAccountWithProfileSearchInput input, Pageable pageable);

  IamAccount getAndCheckById(Long id);

  Page<IamAccountDto> search(IamAccountSearchInput input, Pageable pageable);

  IamAccount getAndCheckNotNullByIdAndDeleteFlagIsFalse(Long accountId);

  IamAccount getAndCheckNotNullByIdAndIamAppIdAndDeleteFlagIsFalse(Long iamAccountId, Long iamAppId);

  Page<IamAccount> adminSearch(Long adminIamAppId, IamAdminAccountAdminSearchInput input, Pageable pageable);

  void modify(IamAccount iamAccount, Integer status, Boolean passwordChangeRequired);

  Long modifyStatus(List<IamAccountModifyStatusInput> input);
}
